{{#if this.session.isAuthenticated}}
  <nav class="navbar navbar-expand-md fixed-top navbar-dark bg-dark">
    <span class="navbar-brand">API Umbrella</span>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
      <ul class="navbar-nav mr-auto">
        {{#if this.currentAdmin.permissions.analytics}}
          <li class="nav-item dropdown nav-analytics">
            <a href="#" class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{t "Analytics"}}</a>
            <div class="dropdown-menu">
              <LinkTo @route="stats.drilldown" class="dropdown-item"><FaIcon @icon="sitemap" @fixedWidth={{true}} /> {{t "API Drilldown"}}</LinkTo>
              <LinkTo @route="stats.logs" class="dropdown-item"><FaIcon @icon="signal" @fixedWidth={{true}} /> {{t "Filter Logs"}}</LinkTo>
              <LinkTo @route="stats.users" class="dropdown-item"><FaIcon @icon="user" @fixedWidth={{true}} /> {{t "By Users"}}</LinkTo>
              <LinkTo @route="stats.map" class="dropdown-item"><FaIcon @icon="map-marker-alt" @fixedWidth={{true}} /> {{t "By Location"}}</LinkTo>
            </div>
          </li>
        {{/if}}
        {{#if (or this.currentAdmin.permissions.user_view this.currentAdmin.permissions.admin_view)}}
          <li class="nav-item dropdown nav-users">
            <a href="#" class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{t "Users"}}</a>
            <div class="dropdown-menu">
              {{#if this.currentAdmin.permissions.user_view}}
                <LinkTo @route="api_users" class="dropdown-item"><FaIcon @icon="user" @fixedWidth={{true}} /> {{t "API Users"}}</LinkTo>
              {{/if}}
              {{#if this.currentAdmin.permissions.admin_view}}
                <LinkTo @route="admins" class="dropdown-item"><FaIcon @icon="user" @fixedWidth={{true}} /> {{t "Admin Accounts"}}</LinkTo>
                <div class="dropdown-divider"></div>
                <div role="presentation" class="dropdown-header">{{t "Permissions Management"}}</div>
                <LinkTo @route="api_scopes" class="dropdown-item"><FaIcon @icon="lock" @fixedWidth={{true}} /> {{t "API Scopes"}}</LinkTo>
                <LinkTo @route="admin_groups" class="dropdown-item"><FaIcon @icon="users" @fixedWidth={{true}} /> {{t "Admin Groups"}}</LinkTo>
              {{/if}}
            </div>
          </li>
        {{/if}}
        {{#if (or this.currentAdmin.permissions.backend_manage this.currentAdmin.permissions.backend_publish)}}
          <li class="nav-item dropdown nav-config">
            <a href="#" class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{t "Configuration"}}</a>
            <div class="dropdown-menu">
              {{#if this.currentAdmin.permissions.backend_manage}}
                <LinkTo @route="apis" class="dropdown-item"><FaIcon @icon="cog" @fixedWidth={{true}} /> {{t "API Backends"}}</LinkTo>
                <LinkTo @route="website_backends" class="dropdown-item"><FaIcon @icon="cog" @fixedWidth={{true}} /> {{t "Website Backends"}}</LinkTo>
              {{/if}}
              {{#if this.currentAdmin.permissions.backend_publish}}
                <LinkTo @route="config.publish" class="dropdown-item"><FaIcon @icon="upload" @fixedWidth={{true}} /> {{t "Publish Changes"}}</LinkTo>
              {{/if}}
            </div>
          </li>
        {{/if}}
      </ul>
      <ul class="navbar-nav">
        <li class="nav-item dropdown">
          <a href="#" id="nav_gear_menu" class="nav-link dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><FaIcon @icon="cog" @fixedWidth={{true}} role="presentation" /></a>
          <div class="dropdown-menu dropdown-menu-right">
            <LinkTo @route="admins.edit" @model={{this.session.data.authenticated.admin.id}} class="dropdown-item" id="my_account_nav_link">{{t "My Account"}}</LinkTo>
            <a href="#" class="dropdown-item" {{action "logout"}}>{{t "Sign out"}}</a>
          </div>
        </li>
      </ul>
    </div>
  </nav>

  <div id="content" class="container-fluid">
    {{outlet}}
  </div>

  <div id="version_footer" class="container-fluid">
    <div class="row">
      <div class="col-12">
        API Umbrella Version {{this.session.data.authenticated.api_umbrella_version}}
      </div>
    </div>
  </div>

  <BusyBlocker />
  <RemoveInitialLoadIndicator />
{{/if}}
